$(function () {
    $("#claim_datagrid").datagrid({
        fitColumns: true,
        fit: true,
        toolbar: '#claim_toolbar',
        url: '/claim/list.do',
        pagination: true,
        striped: true,
        rownumbers: true,
        singleSelect: true,
        columns: [[
            {title: '收款人', field: 'client',align:'center', width: '200'},
            {title: '卡号', field: 'cardnumber' ,align:'center', width: '200'},
            {title: '总金额', field: 'amount' ,align:'center', width: '200'},
            {title: '受损程度', field: 'damagcondition' ,align:'center', width: '200'},
            {title: '保单号', field: 'guardNum' ,align:'center', width: '200'},
        ]]
    })


    var methodObj = {

        //刷新按钮
        reload: function () {
            $("#claim_datagrid").datagrid("reload");
        },
        
        //高级查询
        query: function () {
            var keyword = $("#keyword").textbox("getValue");
            $("#claim_datagrid").datagrid('load', {
                keyword: keyword
            });
        },
    }

    $("a[data-cmd]").click(function () {
        var cmd = $(this).data("cmd");
        methodObj[cmd](this);
    })
})

